import { Context } from "../class/Context";
import { Debuff } from "../class/Effect";
import { Hurt } from "../class/Hurt";
import { Method } from "../class/Method";
import { Role } from "../class/Role";

/**
 * 魔炎龙吟
 */
export class MoYanLongYin extends Method {
    static methodName = "魔炎龙吟"
    public CD: number = 60E3;
    public describe: string = "幻化出龙，九刀齐聚将目标穿透，造成300 + 115%(PA) 物理伤害,同时灼烧敌人，灼烧持续5秒，每秒灼烧100真实伤害。";
    invoke(context: Context): void {
        const itid = context.nextParam();
        const it = this.masterRole.game.getRole(itid);

        const PA = Math.floor(this.masterRole.getPhysicsAttack() * 1.15) + 300;


        it.onHurt(this.masterRole, new Hurt(PA, 0, 0))

        const masterRole = this.masterRole;

        it.addEffectByClass(class extends Debuff {
            public sumTime: number = 5E3;
            public eachTime: number = 1E3;
            public invoke(): void {
                this.masterRole.onHurt(masterRole, new Hurt(0, 0, 100))
            }
        })

    }

}